/*
 * Copyright (c) 2021 Huawei Device Co.,  Ltd.
 * Licensed under the Apache License,  Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,  software
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,  either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef FINANCE_INNERKITS_IRECPTPRINTER_SRV_H
#define FINANCE_INNERKITS_IRECPTPRINTER_SRV_H

#include <string>
#include "iremote_broker.h"
#include "iremote_object.h"
#include "recptprinter_def.h"
#include "icashdevice_srv.h"

namespace SwanLink {
namespace Finance {
using namespace OHOS;

class IRecptprinterSrv : public ICashDeviceSrv {
 public:

    enum {
        RECPTPRINTER_GETPRINTFORMAT = CASHDEBICE_OTHER,
        RECPTPRINTER_SETPRINTFORMAT,
        RECPTPRINTER_GETDEVICESPEC,
        RECPTPRINTER_FEEDPAPER,
        RECPTPRINTER_CUTPAPER,
        RECPTPRINTER_ADDTEXT,
        RECPTPRINTER_ADDBITMAP,
        RECPTPRINTER_ADDQRCODE,
        RECPTPRINTER_ADDBARCODE,
        RECPTPRINTER_STARTPRINT,
    };

   
    /**
     * 获取打印格式
     */
    virtual int GetPrintFormat(int handle, PrintFormatType ftt) = 0;
    /**
     * 设置打印格式
     */
    virtual void SetPrintFormat(int handle, PrintFormatType ftt, int value) = 0;
    /**
     * 获取设备配置
     */
    virtual void GetDeviceSpec(int handle, DeviceSpec &spec) = 0;
    /**
     * 走纸
     */
    virtual int FeedPaper(int handle, int line) = 0;
    /**
     * 切纸
     */
    virtual int CutPaper(int handle, int line, int mode) = 0;
    /**
     * 添加文本
     */
    virtual int AddText(int handle, int x, int y, const std::string& text) = 0;
    /**
     * 添加图片
     */
    virtual int AddBitmap(int handle, int x, int y, const std::string& lpath) = 0;
    /**
     * 添加二维码
     */
    virtual int AddQRCode(int handle, int x, int y, int w, const std::string& qr) = 0;
    /**
     * 添加条码
     */
    virtual int AddBarCode(int handle, int x, int y, BarCodeSpec &spec, const std::string& bar) = 0;
    /**
     * 开始打印
     */
    virtual void StartPrint(int handle, int timeout, PrintListener *listener) = 0;

 public:
    DECLARE_INTERFACE_DESCRIPTOR(u"ohos.finance.IRecptprinterSrv");
};

// typedef IRecptprinterSrv<ICashDeviceSrv>
}  // space Finance
}  // namespace SwanLink

#endif // FINANCE_INNERKITS_IRECPTPRINTER_SRV_H
